from datetime import datetime, timedelta
from sc_engine.apps import messages as msgs
#
# Fetches all proleague schedules
SCRIPT_NAME = 'ProleagueScheduleFetch'

def run(bus):
    start = datetime(2008,10,4)
    end = datetime.today()

    date_range = []
    current = start
    while (current <= end):
        date_range.append(current)
        current += timedelta(days=1)

    for date in date_range:
        bus.send(msgs.ProleagueFetchRequested(date))
